﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ViewAllResults.aspx.cs" Inherits="PollSystem.Registered.ViewAllResults" %>

<asp:Content ID="ContentViewAllResults" ContentPlaceHolderID="MainContent" runat="server">

    <asp:GridView ID="GridViewQuestions" runat="server"
        AutoGenerateColumns="false"
        AllowPaging="true"
        PageSize="3"
        AllowSorting="true"
        SelectMethod="GridViewQuestions_GetData"
        DataKeyNames="QuestionId"
        OnSelectedIndexChanged="GridViewQuestions_SelectedIndexChanged">

        <Columns>
            <asp:BoundField DataField="QuestionText" HeaderText="Question" SortExpression="QuestionText" />
            <asp:CommandField ShowSelectButton="true" SelectText="Details" HeaderText="Details" />
            <asp:HyperLinkField Text="Edit" HeaderText="Edit"
                DataNavigateUrlFields="QuestionId" DataNavigateUrlFormatString="EditQuestion.aspx?questionId={0}" />
        </Columns>

    </asp:GridView>
    <asp:Button ID="ButtonCreateQuestion" runat="server" Text="Create Question" OnClick="ButtonCreateQuestion_Click" Visible="true" />

    <asp:FormView ID="FormViewCreateQuestion" runat="server"
        DefaultMode="Insert"
        Visible="false">

        <EmptyDataTemplate>
            <div>Empty.</div>
        </EmptyDataTemplate>

        <InsertItemTemplate>
            <h4>Question:
                <asp:TextBox ID="TextBoxQuestion" runat="server" ViewStateMode="Disabled"/>
            </h4>
            <asp:Button ID="ButtonSave" Text="Save" runat="server" OnClick="ButtonSave_Click" />
            <asp:Button ID="ButtonCancel" Text="Cancel" runat="server" OnClick="ButtonCancel_Click" />

        </InsertItemTemplate>
    </asp:FormView>

    <h2>Question:
        <asp:Literal runat="server" ID="LiteralQuestion" Mode="Encode"></asp:Literal>
    </h2>

    <asp:Chart ID="ChartVoteResults" runat="server">
        <Series>
            <asp:Series Name="SeriesVotes"></asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1"></asp:ChartArea>
        </ChartAreas>
    </asp:Chart>

</asp:Content>
